This disclosure relates generally to the field of digital image capture operations. More particularly, this disclosure relates to techniques for improved autofocus operations in a digital camera. A camera's autofocus system automatically adjusts the camera lens' position to obtain focus on a subject. As used in this disclosure, the term “camera” refers to any device having digital image capture capability. Examples include, but are not limited to, digital SLR cameras, point-and-shoot digital cameras, mobile phones, laptop or notebook computer systems, tablet computer systems, personal digital assistants, and portable music/video players.
Autofocus systems may generally be divided into two types: active, and passive. Active autofocus systems measure the distance to a subject by emitting, and using, a signal to estimate the distance to the subject (e.g., ultrasound and infrared). The estimated distance is then used to adjust or set the camera's focal length (i.e. lens position). In contrast, passive autofocus systems set a camera's focal length or lens position by analyzing an image captured by the camera's optical system. Passive autofocusing can be achieved through phase detection or contrast measurement.
Many small multifunction devices such as mobile phones use a passive autofocus technique based on contrast measurement. In devices such as these, autofocus operations involve adjusting the position of the device's lens at a specified number of locations and evaluating the focus (e.g., contrast) between corresponding areas in successive images. That lens position corresponding to the maximum contrast, as determined by the number of sharp edges detected, is assumed to correspond to maximum sharpness and best focus.
One problem many autofocus systems suffer from is that they may often focus on the background (rather than the subject). When this happens, the autofocus system sets the focal length so that the background is in focus while the intended subject is out of focus. The problem of background focusing is illustrated by FIG. 1 in which image 100's autofocus region 105 includes flower (subject) 110 and grass (background) 115. Inspection of image 100 shows background grass 115 is in focus while flower 110 is out of focus. This is because, within autofocus area 105, grass 115 contains many more sharp edges than does flower 110. Because of this, the autofocus system judges the lens position needed to bring the background grass into focus as proper.